#pragma once

#include <gio/gio.h>
#include <object_v2/object_v2-string.h>

G_BEGIN_DECLS

#define EVENT_TYPE_CONFIG (event_config_get_type())
G_DECLARE_FINAL_TYPE(EventConfig, event_config, EVENT, CONFIG, GObject)

#define EVENT_CONFIG_DEFAULT_PATH ".config/"
#define EVENT_CONFIG_NAME         "event_and_task"

extern EventConfig *event_config_new();

/**
 * 从规定的路径载入配置文件
 */
extern gboolean event_config_read_config(EventConfig *self);

/**
 * 设置 EventConfig 的用户信息
 */
extern void event_config_set_user_info(EventConfig *self,
                                       const char  *user_class,
                                       const char  *user_name,
                                       const char  *user_password);
/**
 * 写配置文件
 */
extern void          event_config_write_config(EventConfig *self);

extern ObjectString *event_config_reference_user_class(EventConfig *self);

extern ObjectString *event_config_reference_user_name(EventConfig *self);

extern ObjectString *event_config_reference_user_password(EventConfig *self);

G_END_DECLS
